﻿@{
    Style.Require("NineSeas.Books.Summary");
    
    var imageUrl = String.IsNullOrWhiteSpace(Model.Book.ImageUrl) ?
            Href("~/Modules/NineSeas/Images/placeholder-book.png")
            : Model.Book.ImageUrl;

    var tagsHtml = new List<IHtmlString>();
    foreach (var t in Model.Book.Tags.CurrentTags)
    {
        if (tagsHtml.Any())
        {
            tagsHtml.Add(new HtmlString(" "));
        }
        tagsHtml.Add(Html.ActionLink((string)t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = (string)t.TagName }, new { }));
    }
}
<div class="book-leftPane">
    <a href="@Url.Action("Index", "BookView", new {name = Model.Book.NameOnUrl, area = "NineSeas"})">
        <img src="@imageUrl" alt="@Model.Book.Name" class="book-image"/>
    </a>
</div>
<div class="book-rightPane">
    <div class="book-rightPane-header">       
    </div>
    <div class="book-rightPane-content">      
        <a href="@Url.Action("Index", "BookView", new {name = Model.Book.NameOnUrl, area = "NineSeas"})" class="book-name">
            @Model.Book.Name
        </a>
        <div class="book-author" data-id="@Model.Book.AuthorId"></div>
        <div class="book-createdDate">@T("Created") @Model.Book.CreatedDate</div>
        <div class="book-lastUpdatedDate">@T("Last Updated") @Model.Book.LastUpdatedDate</div>
        <div class="book-introduction">
            @(new MvcHtmlString(Model.Book.Introduction))
        </div>
        <div class="tags">@foreach(var htmlString in tagsHtml) { @htmlString }</div>  
    </div>
    <div class="book-rightPane-footer"></div>
</div>